const express = require("express");
const router = express.Router();
const bodyParser = require('body-parser');
const credit = require("../router-handler/credit.js");
router.use(bodyParser.json());


 
router.post('/increase', (req, res) => {
    const { id, data } = req.body;
    // 直接调用 increaseCredit 函数，并传入响应对象 res
    credit.increaseCredit(id, data, res);
  });


  router.post('/update', (req, res) => {
    const { id, data } = req.body;
    // 调用 updateCredit 函数，并传入响应对象 res
    credit.updateCredit(id, data, res);
  });

  module.exports = router;
